<template>
	<view class="container">
		<!-- 安全高度 -->
		<view class="status_bar"></view>
		<view class="account">
			我的账户
		</view>
		<view class="balance">
			我的账户余额 :<text class="balance_money">1000000</text>元
		</view>
		<view class="recharge_card">
			<!-- 充值金额 -->
			<text class="recharge_card_title">充值金额</text>
			<view class="recharge_card_money">
				<view class="money" v-for="(amount,index) in amountList" :key="index" @tap="select(amount)">{{amount}}元
				</view>
			</view>
			<!-- 自定义充值金额 -->
			<view class="custom_money">
				<view class="custom_money_title">自定义充值金额</view>
				<u--input placeholder="请输入自定义金额" border="bottom" clearable fontSize="18px" v-model="inputAmount"
					type="number">
				</u--input>
			</view>
			<!-- 支付方式 -->
			<view class="payment_methods">
				<view class="payment_methods_title">选择支付方式</view>
				<view class="alipay tools" @click="paytype='alipay'">
					<u-icon name="zhifubao" size="30px"></u-icon>
					<view class="tools_title">支付宝支付</view>
					<radio :checked="paytype=='alipay'" color="var(--echo-main-color)" />
				</view>
				<view class="weChat tools" @click="paytype='wxpay'">
					<u-icon name="weixin-fill" size="30px"></u-icon>
					<view class="tools_title">微信支付</view>
					<radio :checked="paytype=='wxpay'" color="var(--echo-main-color)" />
				</view>
			</view>
		</view>
		<!-- 立即充值 -->
		<view class="pay">
			<view class="btn">立即充值</view>
			<view class="tis">
				点击立即充值，即代表您同意<view class="terms">
					《条款协议》
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				paytype: 'alipay', //支付类型
				amountList: [10, 50, 100], //预设3个可选快捷金额
				inputAmount: '', //金额
			}
		},
		methods: {
			select(amount) {
				this.inputAmount = amount;
			},
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		padding: 30rpx;
		
		// 顶部安全距离
		.status_bar {
			height: var(--status-bar-height);
		}

		// 账户
		.account {
			font-size: 32rpx;
		}

		// 余额
		.balance {
			padding: 30rpx 0;
			border-bottom: solid 0.5px #eee;

			.balance_money {
				margin-left: 20rpx;
				margin-right: 20rpx;
			}
		}

		.recharge_card {
			padding: 30rpx 0;

			.recharge_card_title {
				font-size: 32rpx;
			}

			.recharge_card_money {
				margin: 40rpx 0;
				display: flex;
				font-size: 32rpx;
				justify-content: space-around;

				.money {
					width: 25%;
					height: 120rpx;
					line-height: 120rpx;
					text-align: center;
					box-shadow: 0px 2px 10px #ddd;
					background-color: #f1f1f1;
					border-radius: 10rpx;

					&:hover {
						background-color: $echo-main-color;

						color: #fff;
					}
				}
			}

			// 自定义充值金额
			.custom_money {

				.custom_money_title {
					font-size: 32rpx;
					margin-bottom: 30rpx;
				}
			}

			// 充值方式
			.payment_methods {
				padding: 30rpx 0;
				border-bottom: solid 0.5px #eee;

				.payment_methods_title {
					font-size: 32rpx;
					margin-bottom: 30rpx;
				}

				.alipay {
					margin-bottom: 30rpx;
				}

				.tools {
					display: flex;
					justify-content: space-between;
					align-items: center;
					font-size: 32rpx;

					.tools_title {
						width: 65%;
					}
				}

			}
		}

		// 立即支付
		.pay {
			margin-top: 30rpx;
			display: flex;
			justify-content: center;
			flex-wrap: wrap;

			.btn {
				width: 70%;
				height: 80rpx;
				border-radius: 80rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				color: #fff;
				background-color: $echo-main-color;
				box-shadow: 0rpx 5rpx 10rpx rgba(0, 0, 0, 0.2);
			}

			.tis {
				margin-top: 10rpx;
				width: 100%;
				display: flex;
				justify-content: center;
				align-items: baseline;
				color: #999;

				.terms {
					color: #5a9ef7;
				}
			}
		}


	}
</style>
